class test {
    constructor(time = 0) {
        this.time = time;
        this.value = true;
        this.calculate();
    }
    setTime(time) {
        this.time = time;
    }
    calculate() {
        this.__interval__ = setInterval(() => {
            if (this.time == 0 || this.time < 0) {
                this.time = 0;
                clearInterval(this.__interval__);
            } else {
                this.time -= 1;
                this.value = false;
            }
        }, 1000)
    }
    getTime() {
        return this.time;
    }
}